//
//  Link.hpp
//  RoutingEvaluator
//
//  Created by Christopher Kemsley on 4/15/12.
//  Copyright (c) 2012 iAppolopolis. All rights reserved.
//

#import "Object.hpp"
#import "NodeInfo.hpp"
#import "Node.hpp"
#import "LinkInfo.hpp"

NamespaceBegin




class	Link ;
typedef std::vector<Link*>	LinkVector ;




class	Link : public Object
{
public:
	
	// Will create this link (and update the links() property of the appropriate Nodes)
	static Link*		createLink	( LinkInfo* identity , NodeSet* allNodes ) ;
	static Link*		createLink	( LinkInfo* identity , Node* node1 , Node* node2 ) ;
	
	// Will create all links whose cost is less than maxCost
	static LinkVector	createLinks	( LinkInfoSet* costs , NodeSet* allNodes , Float64 maxRange ) ;
	
	Node*			nodeOppositeFrom ( Node * from ) ;
	
	
	LinkInfo*const	identity ;
	
	Node*const		endpoint1 ;
	Node*const		endpoint2 ;
	
	
private:
	Link ( LinkInfo* identity , Node* node1 , Node* node2 ) ;
} ;







NamespaceEnd
